package com.aletto.general_store.ui.adapters;


import android.graphics.Color;

import com.aletto.general_store.R;
import com.aletto.general_store.utils.XHelper;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import androidx.annotation.NonNull;

public class SearchKeywordAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    private final String keyword;

    public SearchKeywordAdapter(String keyword) {
        super(R.layout.item_search_goods_keyword);
        this.keyword = keyword;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, String s) {
        holder.setText(R.id.keyword_text,
                XHelper.matchText(Color.parseColor("#ED5E62"), s, keyword));
    }

}
